
import java.util.Observable;

public class ListCoursesCompleted extends Communication
{

	public ListCoursesCompleted( Integer registrationNumber, String componentName ) {
		super(registrationNumber, componentName);
	}
	
	public void update(Observable thing, Object notificationNumber)
	{
		Menus menu = new Menus();
		Displays display = new Displays();
		Student myStudent = new Student();
		
		if (registrationNumber.compareTo((Integer)notificationNumber) == 0)
		{
			addToReceiverList("ListStudentsComponent");
			signalReceivers("ListStudentsComponent");
			myStudent = menu.pickStudent(CommonData.theListOfStudents.listOfStudents);

			if (myStudent != null) {
				display.displayStudentCoursesTaken(myStudent);
			} else {
				System.out.println("\n\n *** Student not found ***");
			}
		}
		removeFromReceiverList("ListStudentsComponent");
	}
}
